const { merge } = require('webpack-merge')
const commonConfig = require('./webpack.common')
const webpack = require('webpack')
const path = require('path')
// 合并公共配置
module.exports = merge(commonConfig, { 
  mode: 'development', // 开发模式
  devtool: 'cheap-module-eval-source-map', // 调试
  devServer: {
    clientLogLevel: 'warning', // 日历级别
    hot: true, //  HMR
    open: true, // 打开浏览器
    contentBase: [path.join(__dirname, './dist'), 'public', path.join(__dirname, 'src/assets/')], // 获取静态资源
    publicPath: '/',
    compress: true, // 一切服务都启用gzip 压缩：
    port: 9000
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin() // HMR
  ]
})